<%--
 *  File:    DoctorSummary.jsp
 *  @Author: banshang
 *  Date:    2010/07/05
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="http://dcms.oval.com/page/dcms" prefix="dcms" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.DoctorSummary"); 

  //init param
  String strModuleName = "ERM";
  String privilegeCode = "10340";
  String contextPath = request.getContextPath();
  String strTableName = "v_hospitalsummary";
 
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>DoctorSummary</title>
<PageFlow:CheckPageFlow pageName="p_doctorsummary"/>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/summary.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/NewCalendar.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>
<%
HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
Integer employeeid=(Integer)CurUserInfo.get("userid");
%>
<script>
function export_info(){
	var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	var regioncode=document.__otherSearchConditionForm.regioncode.value;  
  var pgroupflag=document.__otherSearchConditionForm.pgroupflag;
  var url ="";
  var pivotins=document.getElementById("pivotins").value;
  if(!pgroupflag.checked){
   if(!isEmpty(regioncode)){
	if(!isEmpty(__searchvalue)){
		//window.open("<%= reportURL %>/servlet/ExcecuteReport/doctorsummary.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
		url="<%=newreportURL %>/xlsrpt?reportname=doctorsummary&employeeid="+<%=employeeid %>+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode));
	}else{
		//window.open("<%= reportURL %>/servlet/ExcecuteReport/doctorsummary.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&regioncode="+escape(encodeURI(regioncode)));
		url="<%=newreportURL %>/xlsrpt?reportname=doctorsummary&employeeid="+<%=employeeid %>+"&regioncode="+escape(encodeURI(regioncode));
	}
   }else{
	alert("<%= message.getMessageDesc("REGION_NOT_NULL")%>");
	popRep();
	return;
   }
  }else{
    if(!isEmpty(__searchvalue)){
		//window.open("<%= reportURL %>/servlet/ExcecuteReport/doctorsummarypgroup.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
    	url="<%=newreportURL %>/xlsrpt?reportname=doctorsummarypgroup&employeeid="+<%=employeeid %>+'&'+__searchname+'='+escape(encodeURI(__searchvalue));
    }else{
		//window.open("<%= reportURL %>/servlet/ExcecuteReport/doctorsummarypgroup.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>);
    	url="<%=newreportURL %>/xlsrpt?reportname=doctorsummarypgroup&employeeid="+<%=employeeid %>;
    }
  }
  url=url+"&timestamp="+Date.parse(new Date())+"&datacategoryval=14";
  DataReport(url);
}

function popRep() {
	//var regionid=cform.regionid.value;
	//var proviceofficecode = document.cform.proviceofficelist.value;
	//var businessareacode = document.cform.businessarealist.value;
	var regioncode=document.__otherSearchConditionForm.regioncode.value;
	var status = "height=400, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
	var url = "<%=contextPath%>/masterdata/ogm/RegionSelect.jsp?<%= OvalTools.randomURL() %>&regioncode="+regioncode;
	
	popwindow = window.open(url, "newwindow", status);
  }

var popwindow;

function page_setRegion(code,name)
{
  if(code != document.__otherSearchConditionForm.regioncode.value)
  {
    //document.cform.citycode.value = " ";
    //document.cform.cityname.value = " ";
    //document.cform.countycode.value = " ";
    //document.cform.countyname.value = " ";
  }
  document.__otherSearchConditionForm.regioncode.value= code;
  document.__otherSearchConditionForm.regionname.value = name;
  if (popwindow != null)
    popwindow.close();
}

</script>
</head>
<body>
<% 
  String str1 = label.getLabelName("L_BasicInfo");
  String str2 = label.getLabelName("L_JobInfo");
  String str3 = label.getLabelName("L_ProdGrading");
  String str4 = label.getLabelName("L_Kinship");
  String str5 = label.getLabelName("L_CureDomain");
%>
<dcms:summary id="erm.zylreportdoctorsummary" summaryDataName="doctorsummary" needNew="true" newTabID="mainTab" editTabID="mainTab" needEdit="true" >
    <dcms:param name="userid" property="session:userinfo.userid"/>
    <dcms:param name="pivotins" property="pivotinfo.pivotins"/>
	<dcms:summaryTab id="mainTab" name="<%=str1%>"  href="/phap/masterdata/erm/DoctorEdit.jsp"/> 
	<dcms:summaryTab id="jobTab" name="<%=str2%>"  href="/phap/masterdata/erm/JobInfo.jsp"/> 
	<dcms:summaryTab id="prodTab" name="<%=str3%>"  href="/phap/masterdata/erm/ProdInfo.jsp"/> 
	<dcms:summaryTab id="relationTab" name="<%=str4%>"  href="/phap/masterdata/erm/RelationInfo.jsp"/> 
	<dcms:summaryTab id="professionTab" name="<%=str5%>"  href="/phap/masterdata/erm/ProfessionInfo.jsp"/>
	<dcms:summaryAction actionFuction="__export('XLSXQ')" labelCode="L_ALL_Execcd" styleWidth="70" privilegeCode="MB-YS03"/>
	<dcms:summaryAction actionFuction="export_info" labelCode="L_Upload_Derived" styleWidth="77" privilegeCode="MB-YS04"/>
	<dcms:otherSearchCondition>
   <iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
     <table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr style="text-align:left" >
			 <td class="text-align:left"><%=label.getLabelName("L_MaintainProductGroup") +  label.getLabelName("L_Colon") %><custom:checkbox property="pgroupflag" /></td>
			</tr>
			<tr style="text-align:left" >
			 <td class="text-align:left"><%=label.getLabelName("L_Province") +  label.getLabelName("L_Colon") %>
				<!-- <td style="width:150px;" class="text-align:left"> -->
					<custom:text property="regionname" size="20" readonly="false" style="border:1px #7F9DB9 solid;" />
                    <a onClick="javascript:popRep();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a>
                    <custom:hidden property="regioncode" />
              </td>
			</tr>
        </table>
  </dcms:otherSearchCondition>  
</dcms:summary>
</body>
<script>
  document.getElementById("__searchvalue").onkeydown=function seachKeyDown()
  {
   // alert(event.keyCode);
    if(event.keyCode==13)
    {
      __summaryGo(document.getElementById("__summaryConfigID").value,document.getElementById("__indicatorImagePath").value,document.getElementById("__summaryRootPath").value,'');
    }
  }
</script> 
</html>